package java3_31.SuperMarket;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        SuperMarket m=SuperMarket.read();
        if(m==null){
            System.out.println("新店开张");
            m= new SuperMarket();
            System.out.print("请输入名字：");
            m.setName(in.next());
            System.out.print("请输入地址：");
            m.setAddress(in.next());
        }
        m.start();
        while (true){
            System.out.println("1:开卡，2：查看，3：兑换，9：退出");
            int choice = in.nextInt();
            switch (choice){
                case 1:{
                    System.out.println("请输入会员信息(卡号，姓名，积分和手机号)：");
                    m.add(new Member( in.next(),in.next(),in.nextInt(),in.next()));
                    break;
                }
                case 2:{
                    m.marketShow();
                    break;
                }
                case 9:{
                    SuperMarket.store(m);
                    return;
                }
                default:return;
            }
        }
    }
}
